package com.ruixin.mvc.config;

import com.ruixin.base.exception.BaseException;

/**
 * 请求类型
 */
public enum RequestType {
    POST,GET,PUT,DELETE;

    /**
     * 类型转换
     * @param type
     * @return
     * @throws BaseException
     */
    public static RequestType parse(String type) throws BaseException {
        switch (type.toUpperCase()){
            case "POST":return POST;
            case "GET":return GET;
            case "PUT":return PUT;
            case "DELETE":return DELETE;
            default:
                throw new BaseException("暂时不支持该类型！");
        }
    }
}
